package com.beiji.lib.pen.device

import android.app.Application
import com.beiji.lib.pen.constants.PenConnectState
import com.beiji.lib.pen.listener.IPenDataListener
import com.beiji.lib.pen.model.PenInfo

/**
 * 数码笔通用接口
 * Created by X on 2018/6/13.
 */
abstract class IPen {

    internal var penDataListener: IPenDataListener? = null

    internal var penInfo: PenInfo? = null

    internal var currentConnectState: PenConnectState = PenConnectState.DISCONNECTED

    /**
     * 初始化
     */
    abstract fun init(application: Application)

    /**
     * 连接
     */
    abstract fun connect(): Boolean

    /**
     * 断开连接
     */
    abstract fun disConnect()

    /**
     * 获取连接状态
     */
    abstract fun getConnectState(): PenConnectState

    /**
     * 设置笔的名字
     */
    abstract fun setPenName(name: String)

    /**
     * 获取蓝牙笔的信息
     */
    abstract fun requestPenInfo()

    /**
     * 获取离线数据量
     */
    abstract fun getPenOfflineDataCount()

    /**
     * 下载离线数据
     */
    abstract fun downloadOfflineData()

    /**
     * 停止离线数据
     */
    abstract fun stopOfflineData()

    /**
     * 移除离线数据
     */
    abstract fun removeOfflineData()

}